home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Interactive Media Design Review 1999
/
Interactive Media Design Review 1999.iso
/
pc
/
Demos
/
Herois
/
Codigo.Cst
/
00027_Script_Fundo Sonoro
< prev
next >
Wrap
Text File
|
1999-03-19
|
2KB
|
81 lines
property memSom
property ligado
property tempoIn
property minTocando, maxTocando
property memoria, limitado
on getBehaviorDescription
return "Faz busca automatica de palavra clicada"
end
on getPropertyDescriptionList
set p_list = [ ¼
#memSom: [ #comment: "Membro que contem som",¼
#format: #string, ¼
#default: "MembroSom" ],¼
#tempoIn: [ #comment: "Tempo de fadeIn",¼
#format: #integer, ¼
#default: 120 ],¼
#minTocando: [ #comment: "Tempo minimo que o som fica tocando",¼
#format: #integer, ¼
#default: 300],¼
#maxTocando: [ #comment: "Tempo maximo que o som fica tocando",¼
#format: #integer, ¼
#default: 800 ],¼
#memoria: [ #comment: "Memoria minima para tocar este som",¼
#format: #integer, ¼
#default: 0 ]¼
]
return p_list
end
on beginSprite me
global myMemSize
if memoria * 1024 * 1024 > myMemSize then
set limitado = true
else
set limitado = false
set ligado = false
if the number of member memSom <> -1 then
preloadMember member memSom
end if
end if
end
on cleanSprite me
if (not limitado) and ligado then
global gFundoTempo
sound fadeOut 1, tempoIn
set gFundoTempo = the timer + tempoIn + 30
set ligado = false
end if
end
on idleSprite me
if limitado then return
global gMustUpdate
global gFundoTempo
if ligado then
if the timer >= gFundoTempo then
if soundBusy(1) then sound fadeOut 1, tempoIn
set gMustUpdate to true
set ligado = false
set gFundoTempo = the timer + tempoIn + random(maxTocando - minTocando) + minTocando
end if
else -- Som desligado, espera o tempo para religar
if the timer >= gFundoTempo then
set gMustUpdate to true
puppetSound 1, 0
updateStage
set the volume of sound 1 to 255
updateStage
if the number of member memSom <> -1 then
puppetSound 1, memSom
end if
sound fadeIn 1, tempoIn
set ligado = true
set gFundoTempo = the timer + random(maxTocando - minTocando) + minTocando
end if
end if
end